package com.fox.imagedb.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import com.fox.imagedb.gui.menu.item.ImageDBMenuItem;

public class ImageDBMenuListener implements ActionListener, ItemListener {

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() instanceof ImageDBMenuItem) {
			ImageDBMenuItem source = (ImageDBMenuItem) (e.getSource());
			source.performAction();
		}

	}

	@Override
	public void itemStateChanged(ItemEvent e) {

	}

	protected String getClassName(Object o) {
		String classString = o.getClass().getName();
		int dotIndex = classString.lastIndexOf(".");
		return classString.substring(dotIndex + 1);
	}

}
